package com.lyb.hrm.feignclients;


import com.lyb.hrm.fallback.FastdfsFeignClientFallbackFactory;
import com.lyb.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

//value属性：调用目标服务的服务名
@FeignClient(value="fastdfs-server", fallbackFactory = FastdfsFeignClientFallbackFactory.class)
public interface FastdfsFeignClient {

    //文件下载
    @PostMapping("/fastdfs/download")
    byte[] download(@RequestParam("path") String path);

    //文件上传
    @PostMapping("/fastdfs/uploadBytes")
    AjaxResult uploadBytes(@RequestBody byte[] file, @RequestParam("extName") String extName);



}
